home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / ubas830.zip / MALM.EXE / LAMBDA.UB < prev    next >
Text File  |  1990-08-22  |  600b  |  17 lines

  1.  4440   *Lambda(&P(),&M(),K,&Lam)
  2.  4450   ' P() and M() are input parameters. This computes the smallest
  3.  4460   ' universal exponent.  Modeled on the Pascal version.
  4.  4470   ' 10 May 1990
  5.  4480   local I,J,Ii,T,Te
  6.  4490   if K=0 then Lam=0:return endif
  7.  4500   Ii=1:Lam=1
  8.  4510   if P(1)=2 then
  9.  4520   :if M(1)=2 then Lam=2 else for I=1 to M(1)-2:Lam=2*Lam next I endif
  10.  4530   :Ii=2 endif
  11.  4540   for J=Ii to K
  12.  4550   Te=1:T=P(J)
  13.  4560   for I=1 to M(J)-1:Te*=T next I
  14.  4570   T=T-1:Te*=T:T=Lam*Te
  15.  4580   Te=gcd(Lam,Te):Lam=T\Te
  16.  4590   next J:return ' End of subroutine Lambda.
  17.